image

Blindness Detection

Importing Libraries

We are uisng the following versions of the libraries:

How we can install the libraries in python?

To install the python library is very easy

Exploratory Data Analysis

Loading Data

Data Visualization and EDA

as per below bar chart, it clearly showing that data set is quite imbalance. And even it's expected in medical domain.

Both training and testing datasets are not too large.

Training dataset is about 3 times greater than the testing dataset.

Analyze Train Set Labels

Stages Of Diabetic Retinopathy

Split dataset into training and testing

Images data visualziation of different classes

Max Min Height and Width

GrayScale Images

Converting the Ratina Images into Grayscale. So, we can usnderstand the regin or intest .

It's clearly showing, that the image [0,1] has give regin black around the EYE ball. Which is ust noise, that will not add any value fo model. We need to remove this black area. in my next iteration will work on that to crop black are from image.

Image Cropping

Some images has big blank space. they will take only computation power and add noise to model. So better will will crop the blank spaces from images.

Data Pre-Processing

Image Data Generator

In this section willl use Keras ImageDataGenerator class for generating data for Keras model. It is used for data generation, increasing the data size. with the help of ImageDataGenerator we will do image "augment" via a number of random transformations, so that our model would never see twice the exact same picture.

Training Deep Learning model can perform better with more data, and augementation technique can create variations of data that can increase the ababiliy of fit model to gene

ResNet 50 Model using as transfer learning

Training and validating

Testing the Trained model with test data

Accuracy

Precision, Recall, F1

Confusion matrix

DenseNet Model using as transfer learning

Training and validating

Testing the Trained model with test data

Accuracy

Precision, Recall, F1

Confusion matrix

Xception Model using as transfer learning

Training and validating

Testing the Trained model with test data

Accuracy

Precision, Recall, F1

Confusion matrix

InceptionResNet Model using as transfer learning

Training and validating

Testing the Trained model with test data

Accuracy

Precision, Recall, F1

Confusion matrix

Accuracy Comparison of all models Results

There is no big difference in the results of all models but overall Resnet model results are higher than other pre-trained models.